package com.sikao.app.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.sikao.app.R;

import java.util.List;

/**
 * Created by Administrator on 2016/8/9.
 */
public class HotInformationAdapter extends BaseAdapter {


	private List<String> objects;
	private Context context;
	private LayoutInflater layoutInflater;

	public HotInformationAdapter(Context context, List<String> objects) {
		this.context = context;
		this.layoutInflater = LayoutInflater.from(context);
		this.objects = objects;


	}


	@Override
	public int getCount() {
		return 5;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder viewHolder;
		View view;
		if (convertView == null) {
			view = layoutInflater.inflate(R.layout.news_list_item, null);
			viewHolder = new ViewHolder(view);
			view.setTag(viewHolder);
		} else {
			view = convertView;
			viewHolder = (ViewHolder) view.getTag();
		}
		viewHolder.tvtitle.setText("标题");
		viewHolder.contenttv.setText("内容");
		viewHolder.tvtime.setText("2016");
		viewHolder.tvname.setText("吕永胜");
		viewHolder.tvbrowsevolume.setText("12");
		return view;
	}

	public class ViewHolder {
		public final TextView tvtitle;
		public final TextView tvtime;
		public final TextView contenttv;
		public final TextView tvname;
		public final TextView tvbrowsevolume;
		public final View root;

		public ViewHolder(View root) {
			tvtitle = (TextView) root.findViewById(R.id.tv_title);
			tvtime = (TextView) root.findViewById(R.id.tv_time);
			contenttv = (TextView) root.findViewById(R.id.content_tv);
			tvname = (TextView) root.findViewById(R.id.tv_name);
			tvbrowsevolume = (TextView) root.findViewById(R.id.tv_browse_volume);
			this.root = root;
		}
	}
}
